<!-- doUserReg.php 用于将用户输入的注册信息添加到数据库。 -->
<?php
  
  require_once('inc_admin.php');
  //连接数据库		
  connect();

  if(!empty($_FILES["wyy_pic"]["wyy_name"])){
   	$wyy_pic = uploadfile('wyy_pic',UserPhotoPath,array('jpg','gif','png'));
   }
   else{
   	$wyy_pic='';
   }

  $data = array(
		'wyy_id'=>trim($_POST['wyy_id']),
    'wyy_title'=>trim($_POST['wyy_title']),
    'wyy_pic'=>trim($_POST['wyy_pic']),
    'wyy_place'=>trim($_POST['wyy_place']),
    'wyy_intro'=>trim($_POST['wyy_intro']),
    'wyy_adddate'=>trim($_POST['wyy_adddate']),
    'wyy_hint'=>trim($_POST['wyy_hint'])
  	);

  //执行SQL语句
	$result = add('flower',$data);

  if(!$result){
  	echo "添加失败！<br/>";
  	echo "<a href='addflower.html'>返回</a>";	  
  }else{	  
   redirect('flowerlist.php','添加成功!'); 
  }    
  
?>